<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
<%@ taglib prefix="html" uri="http://struts.apache.org/tags-html" %>
<%@ page import="javax.sql.*"%>
<%@ page import="model.*"%>

<html:html>
<head>
    <title>Application Data</title>
</head>

<body>
<font size="6">Review Application</font><p>
	<%
	
	RowSet crsAppInfo = (RowSet)request.getAttribute("crsAppInfo");
	RowSet crsDegInfo = (RowSet)request.getAttribute("crsDegInfo");
	
	crsAppInfo.next();
	%>
	<html:form method="post" action ="/submitReview">
	<b>Grade:</b> <br>(lowest)
			<html:radio property="grade" value="1"/>1
			<html:radio property="grade" value="2"/>2
			<html:radio property="grade" value="3"/>3
			<html:radio property="grade" value="4"/>4 (highest)<br>
	<b>Comment:</b><br>
		<html:textarea property="comment" />
		<html:submit>Submit</html:submit>
	</html:form>

	<ul style="list-style:none; margin: 0px;"> 
        <li><b>First Name: </b><%=crsAppInfo.getString("first_name")%> </li> 
        <li><b>Middle Name: </b><%=crsAppInfo.getString("middle_initial")%> </li>
        <li><b>Last Name: </b><%=crsAppInfo.getString("last_name")%></li>
    </ul> <br>
    
    <b>Country of citizenship: </b><%=crsAppInfo.getString("citizenship")%> <br>
    <b>Country of residence: </b><%=crsAppInfo.getString("residence")%> <br>
    
    <p>
    <b>Address: </b><%=crsAppInfo.getString("street_address")%> <br>
    <b>City: </b><%=crsAppInfo.getString("city")%> <br>
    
    <%
    // if "state" is NOT null, means they came from addressPage directly, means they ARE a US citizen
    if (crsAppInfo.getString("citizenship").equals("United States"))  {
    	out.println ("<b>State: </b>" + crsAppInfo.getString("state_code"));
    }
    // else means they came from residencyPage, means they ARE NOT a US citizen
    else  {
    	out.println ("<b>Country Code: </b>" + crsAppInfo.getString("state_code"));
    }
    %>
    
    <br>
    <b>Zip Code: </b><%=crsAppInfo.getString("zip_code")%> <br>
    <b>Area Code: </b><%=crsAppInfo.getString("area_code")%> <br>
    <b>Telephone Number: </b><%=crsAppInfo.getString("phone_number")%>
    
    <p>
    
    <% while(crsDegInfo.next()){%>
	
	<br>
	<b>Location of university: </b>  <%=crsDegInfo.getString("location")%>
    <br>
    <b>University name: </b> <%=crsDegInfo.getString("university")%> <br>
    
    
    <b>Major: </b> <%=crsDegInfo.getString("major")%>
    <br>
    <b>Degree title: </b><%=crsDegInfo.getString("degree_title")%>
    <br>
    <b>Month: </b><%=crsDegInfo.getString("month")%>
    <br>
    <b>Year: </b><%=crsDegInfo.getString("year")%>
    <br>
    <b>GPA: </b><%=crsDegInfo.getString("gpa")%>
    <p>
    <% 
    }%>
	
	<b>Specialization: </b> <%=crsAppInfo.getString("specialization")%><p>

</body>
</html:html>